﻿using System;
using System.Collections;
using System.Collections.Specialized;
using System.IO;
using System.Text;
using System.Web;
using System.Web.Caching;

namespace RoketSolutions.SP2010.Infrostructure.UI.Ajax.Abstractions
{
    public class ResponseWrapper
    {
        public ResponseWrapper(HttpResponse response)
        {
            HttpResponse = response;
        }

        public ResponseWrapper()
        {
            
        }

        public HttpResponse HttpResponse { get; set; }

        #region / Properties /

        public bool Buffer
        {
            get { return HttpResponse.Buffer; }
            set { HttpResponse.Buffer = value; }
        }

        public bool BufferOutput
        {
            get { return HttpResponse.BufferOutput; }
            set { HttpResponse.BufferOutput = value; }
        }

        public HttpCachePolicy Cache
        {
            get { return HttpResponse.Cache; }
        }

        public string CacheControl
        {
            get { return HttpResponse.CacheControl; }
            set { HttpResponse.CacheControl = value; }
        }

        public string Charset
        {
            get { return HttpResponse.Charset; }
            set { HttpResponse.Charset = value; }
        }

        public Encoding ContentEncoding
        {
            get { return HttpResponse.ContentEncoding; }
            set { HttpResponse.ContentEncoding = value; }
        }

        public string ContentType
        {
            get { return HttpResponse.ContentType; }
            set { HttpResponse.ContentType = value; }
        }

        public HttpCookieCollection Cookies
        {
            get { return HttpResponse.Cookies; }
        }

        public int Expires
        {
            get { return HttpResponse.Expires; }
            set { HttpResponse.Expires = value; }
        }

        public DateTime ExpiresAbsolute
        {
            get { return HttpResponse.ExpiresAbsolute; }
            set { HttpResponse.ExpiresAbsolute = value; }
        }

        public Stream Filter
        {
            get { return HttpResponse.Filter; }
            set { HttpResponse.Filter = value; }
        }

        public Encoding HeaderEncoding
        {
            get { return HttpResponse.HeaderEncoding; }
            set { HttpResponse.HeaderEncoding = value; }
        }

        public NameValueCollection Headers
        {
            get { return HttpResponse.Headers; }
        }

        public bool IsClientConnected
        {
            get { return HttpResponse.IsClientConnected; }
        }

        public bool IsRequestBeingRedirected
        {
            get { return HttpResponse.IsRequestBeingRedirected; }
        }

        public TextWriter Output
        {
            get { return HttpResponse.Output; }
        }

        public Stream OutputStream
        {
            get { return HttpResponse.OutputStream; }
        }

        public string RedirectLocation
        {
            get { return HttpResponse.RedirectLocation; }
            set { HttpResponse.RedirectLocation = value; }
        }

        public string Status
        {
            get { return HttpResponse.Status; }
            set { HttpResponse.Status = value; }
        }

        public int StatusCode
        {
            get { return HttpResponse.StatusCode; }
            set { HttpResponse.StatusCode = value; }
        }

        public string StatusDescription
        {
            get { return HttpResponse.StatusDescription; }
            set { HttpResponse.StatusDescription = value; }
        }

        public int SubStatusCode
        {
            get { return HttpResponse.SubStatusCode; }
            set { HttpResponse.SubStatusCode = value; }
        }

        public bool SuppressContent
        {
            get { return HttpResponse.SuppressContent; }
            set { HttpResponse.SuppressContent = value; }
        }

        public bool TrySkipIisCustomErrors
        {
            get { return HttpResponse.TrySkipIisCustomErrors; }
            set { HttpResponse.TrySkipIisCustomErrors = value; }
        }

        #endregion

        #region / Methods /

        public virtual void AddCacheDependency(params CacheDependency[] dependencies)
        {
            HttpResponse.AddCacheDependency(dependencies);
        }

        public virtual void AddCacheItemDependencies(ArrayList cacheKeys)
        {
            HttpResponse.AddCacheItemDependencies(cacheKeys);
        }

        public virtual void AddCacheItemDependencies(string[] cacheKeys)
        {
            HttpResponse.AddCacheItemDependencies(cacheKeys);
        }

        public virtual void AddCacheItemDependency(string cacheKey)
        {
            HttpResponse.AddCacheItemDependency(cacheKey);
        }

        public virtual void AddFileDependencies(string[] filenames)
        {
            HttpResponse.AddFileDependencies(filenames);
        }

        public virtual void AddFileDependencies(ArrayList filenames)
        {
            HttpResponse.AddFileDependencies(filenames);
        }

        public virtual void AddFileDependency(string filename)
        {
            HttpResponse.AddFileDependency(filename);
        }

        public virtual void AddHeader(string name, string value)
        {
            HttpResponse.AddHeader(name, value);
        }

        public virtual void AppendCookie(HttpCookie cookie)
        {
            HttpResponse.AppendCookie(cookie);
        }

        public virtual void AppendHeader(string name, string value)
        {
            HttpResponse.AddHeader(name, value);
        }

        public virtual void AppendToLog(string param)
        {
            HttpResponse.AppendToLog(param);

        }

        public virtual string ApplyAppPathModifier(string virtualPath)
        {
            return HttpResponse.ApplyAppPathModifier(virtualPath);
        }

        public virtual void BinaryWrite(byte[] buffer)
        {
            HttpResponse.BinaryWrite(buffer);
        }

        public virtual void Clear()
        {
            HttpResponse.Clear();
        }

        public virtual void ClearContent()
        {
            HttpResponse.ClearContent();
        }

        public virtual void ClearHeaders()
        {
            HttpResponse.ClearHeaders();
        }

        public virtual void Close()
        {
            HttpResponse.Close();
        }

        public virtual void DisableKernelCache()
        {
            HttpResponse.DisableKernelCache();
        }

        public virtual void End()
        {
            HttpResponse.End();
        }

        public virtual void Flush()
        {
            HttpResponse.Flush();
        }

        public virtual void Pics(string value)
        {
            HttpResponse.Pics(value);
        }

        public virtual void Redirect(string url)
        {
            HttpResponse.Redirect(url);
        }

        public virtual void Redirect(string url, bool endResponse)
        {
            HttpResponse.Redirect(url, endResponse);
        }

        public virtual void RemoveOutputCacheItem(string path)
        {
            HttpResponse.RemoveOutputCacheItem(path);
        }

        public virtual void SetCookie(HttpCookie cookie)
        {
            HttpResponse.SetCookie(cookie);
        }

        public virtual void TransmitFile(string filename)
        {
            HttpResponse.TransmitFile(filename);
        }

        public virtual void TransmitFile(string filename, long offset, long length)
        {
            HttpResponse.TransmitFile(filename, offset, length);
        }

        public virtual void Write(char ch) { HttpResponse.Write(ch); }

        public virtual void Write(object obj)
        {
            HttpResponse.Write(obj);
        }

        public virtual void Write(string s)
        {
            HttpResponse.Write(s);
        }

        public virtual void Write(char[] buffer, int index, int count)
        {
            HttpResponse.Write(buffer, index, count);
        }

        public virtual void WriteFile(string filename)
        {
            HttpResponse.WriteFile(filename);
        }

        public virtual void WriteFile(string filename, bool readIntoMemory)
        {
            HttpResponse.WriteFile(filename, readIntoMemory);
        }

        public virtual void WriteFile(IntPtr fileHandle, long offset, long size)
        {
            HttpResponse.WriteFile(fileHandle, offset, size);
        }

        public virtual void WriteFile(string filename, long offset, long size)
        {
            HttpResponse.WriteFile(filename, offset, size);
        }

        public virtual void WriteSubstitution(HttpResponseSubstitutionCallback callback)
        {
            HttpResponse.WriteSubstitution(callback);
        }

        #endregion

    }
}